object Sheet1 {
  def main(args: Array[String]): Unit = {

    var keepGoing = true

    var sum: Int = 0
    for (unit <- 1 to 10 if keepGoing) {
      def continuable(): Unit = {
        if (unit == 5) {
          return
        }
        sum += unit
      }

      if (unit == 10) {
        keepGoing = false
      } else {
        continuable()
      }
    }

    println(s"$sum")

  }
}
